package model.impl.network;

import model.impl.CentroidImpl;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.resotc.model.Centroid;

public class ElementImplTest {

//	Intersection intersection1 = new IntersectionImpl(0, 0, true, 30, 30);
//	Intersection intersection2 = new IntersectionImpl(1, 0, false, 30, 0);
	Centroid centroid1 = new CentroidImpl(1, 0, 0, 0);
	Centroid centroid2 = new CentroidImpl(2, 0, 0, 0);

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testIsNeighbour() {
//		intersection1.isNeighbour(intersection2);
//		assertTrue(intersection1.isNeighbour(intersection2));
//		assertFalse(intersection1.isNeighbour(centroid2));
	}

//	@Test
//	public void testEquals() {
//		assertTrue(intersection1.equals(intersection1));
//		assertFalse(intersection1.equals(centroid2));
		
//		ArrayList<Element> preList = new ArrayList<Element>();
//		ArrayList<Element> sucList = new ArrayList<Element>();
		// put a predecessor and a successor from a lane in lists and check if
		// contains works properly with the overwritten equals method
//		try {
//			StreetDAO streetDAO = new StreetDAOImpl();
//			HashMap<Integer, Street> streets = streetDAO.getStreets();
			
//			ArrayList<Street> streetList = new ArrayList<Street>(streets.values());
			
//			for(Street street : streetList){
//				HashMap<Integer, Lane> lanes = street.getLanes();
//				ArrayList<Lane> laneList = new ArrayList<Lane>(lanes.values());
//				
//				for(Lane lane : laneList) {
//					preList.add(lane.getPredecessor());
//					sucList.add(lane.getSuccessor());
//					
//					if(lane.getPredecessor().equals(intersection1)) {
//						System.out.println("test");
//					}
//				}
//			}
//		} catch (JDOMException e) {
//			// TODO Aut-generated catch block
//			e.printStackTrace();
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		
//		System.out.println("preList: " + preList);
//		System.out.println("sucList: " + sucList);
//	}

	@Test
	public void testDetermineNeighbours() {

	}

	@Test
	public void testGetConnectedStreets() {
//		System.out.println(intersection1.getConnectedStreets());
	}

}
